<%--
  Created by IntelliJ IDEA.
  User: DongZhengWei
  Date: 2018/11/5
  Time: 16:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	String _id=request.getParameter("_");
%>

<form id="form_post_input" class="form-horizontal">
	<input type="hidden" name="keyId" id="keyId" value="${post.id}"/>

	<div class="form-group">
		<label class="col-md-2 control-label">岗位名称</label>
		<div class="col-md-8">
			<input type="text" class="form-control" id="name" name="name" value="${post.name}" placeholder="请输入岗位名称" />
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label">部门描述</label>
		<div class="col-md-8">
			<input type="text" name="description" id="description" value="${post.description}" class="form-control" placeholder="请输入岗位描述">
		</div>
	</div>

</form>

<script>

	$(function(){
        fn_post_input_validate();
	});

	//表单验证
	function fn_post_input_validate(){
        __init_bootstrapValidator("form_post_input", {
            name : {
                validators : {
                    notEmpty : {
                        message : "请输入岗位名称"
                    }
                }
            }
        });
	}

    //保存
    function fn_post_input_save(callback){
        if(__is_validate("form_post_input")){
            __confirm_dialog(null, "确定保存吗？", function(){
                __form_save("form_post_input", "<%=path%>/main/post/save", function(data){
                    callback(data.state==1 ? data.data : null);
                })
            });
        }
    }

</script>